#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include "RBTree.h"
#include "map.h"
#include "set.h"

void TestMap()
{
	zhang::map<int, int> mp;
	mp.insert(std::make_pair(2, 2));
	mp.insert(std::make_pair(1, 1));
	mp.insert(std::make_pair(3, 3));
	mp.insert(std::make_pair(7, 7));
	mp.insert(std::make_pair(5, 5));
	mp.insert(std::make_pair(9, 9));

	zhang::map<int, int>::iterator it = mp.begin();
	std::cout << it->first << std::endl;

	while (it != mp.end())
	{
		std::cout << it->first << ":" << it->second << " ";
		++it;
	}
	std::cout << std::endl;

	mp[1] = 10;
	it = mp.begin();
	std::cout << it->first << ":" << it->second << std::endl;
}


void TestSet()
{
	zhang::set<int> st;

	int arr[] = { 5,8,1,3,5,8,9,10 };
	for (const auto& e : arr)
	{
		st.insert(e);
	}

	zhang::set<int>::iterator it = st.begin();
	while (it != st.end())
	{
		std::cout << *it << " ";
		++it;
	}
	std::cout << std::endl;

}


int main()
{
	//TestMap();
	TestSet();
	return 0;
}